import {useState} from "react";
import {View} from "@tarojs/components";
import './tabs1.scss'

export default function Tabs1({title, tabs}) {
  const [curIndex, setCurIndex] = useState(0)
  return (
    <View className='tabs1box'>
      <View className='title'>{title}</View>
      <View className='itemboxs1'>
        {
          tabs.map((item, index) => {
            return <View onClick={() => setCurIndex(index)} className={`item ${curIndex === index ? 'active': ''}`} key={index}>{item.name}</View>
          })
        }
      </View>
    </View>
  )
}
